package com.ctshk.rpc.season.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ctshk.common.enums.IsDeletedCode;
import com.ctshk.common.utils.EntityUtil;
import com.ctshk.rpc.season.dto.SeasonProOfflineSelfCustomDTO;
import com.ctshk.rpc.season.dto.SeasonProductChannelOfflineSelfCustomArrayDTO;
import com.ctshk.rpc.season.entity.SeasonProductChannelOfflineSelfCustom;
import com.ctshk.rpc.season.mapper.SeasonProductChannelOfflineSelfCustomMapper;
import com.ctshk.rpc.season.service.ISeasonProductChannelOfflineSelfCustomService;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * <p>
 * 套票线下自营自定义权限 服务实现类
 * </p>
 *
 * @author 杨林
 * @since 2021-03-15
 */
@DubboService
public class SeasonProductChannelOfflineSelfCustomServiceImpl extends ServiceImpl<SeasonProductChannelOfflineSelfCustomMapper, SeasonProductChannelOfflineSelfCustom> implements ISeasonProductChannelOfflineSelfCustomService {

   @Autowired
   private SeasonProductChannelOfflineSelfCustomMapper selfCustomMapper;

    /* @MethodName: 线下自营 自定义 设置数据xian'xi详细值
     * @Description: TODO
     * @Param * @Return:
     * @Author: 杨林
     * @Date:2021/3/18 17:21
    **/
    @Override
    public List<SeasonProductChannelOfflineSelfCustomArrayDTO> getSetInfoByOfflineId(Long offlineId) {
        List<SeasonProductChannelOfflineSelfCustom> list= selfCustomMapper.selectList(
                new QueryWrapper<SeasonProductChannelOfflineSelfCustom>().lambda()
                .eq(SeasonProductChannelOfflineSelfCustom::getOfflineId,offlineId)
                .eq(SeasonProductChannelOfflineSelfCustom::getIsDeleted, IsDeletedCode.NO.getCode())
        );

        return EntityUtil.copyList(list,SeasonProductChannelOfflineSelfCustomArrayDTO.class);
    }
    public SeasonProOfflineSelfCustomDTO querySelf(Long fixedSeasonId) {
        return selfCustomMapper.querySelf(fixedSeasonId);
    }
}
